package integral

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type IntegralsRouter struct {}

// InitIntegralsRouter 初始化 integrals表 路由信息
func (s *IntegralsRouter) InitIntegralsRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	integralsRouter := Router.Group("integrals").Use(middleware.OperationRecord())
	integralsRouterWithoutRecord := Router.Group("integrals")
	integralsRouterWithoutAuth := PublicRouter.Group("integrals")
	{
		integralsRouter.POST("createIntegrals", integralsApi.CreateIntegrals)   // 新建integrals表
		integralsRouter.DELETE("deleteIntegrals", integralsApi.DeleteIntegrals) // 删除integrals表
		integralsRouter.DELETE("deleteIntegralsByIds", integralsApi.DeleteIntegralsByIds) // 批量删除integrals表
		integralsRouter.PUT("updateIntegrals", integralsApi.UpdateIntegrals)    // 更新integrals表
	}
	{
		integralsRouterWithoutRecord.GET("findIntegrals", integralsApi.FindIntegrals)        // 根据ID获取integrals表
		integralsRouterWithoutRecord.GET("getIntegralsList", integralsApi.GetIntegralsList)  // 获取integrals表列表
	}
	{
	    integralsRouterWithoutAuth.GET("getIntegralsPublic", integralsApi.GetIntegralsPublic)  // integrals表开放接口
	}
}
